import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class TransformDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TransformDemoPageState();
  }
}

class TransformDemoPageState extends State<TransformDemoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text('Transform例子')),
        body: Container(
          color: Colors.blue,
          child: Center(
            child: Container(
              height: 150,
              margin: EdgeInsets.symmetric(horizontal: 10),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Transform.translate(
                    offset: Offset(0, -30),
                    child: Container(
                      width: 72.0,
                      height: 72.0,
                      decoration: BoxDecoration(
                          boxShadow: [
                            BoxShadow(
                                color: Theme.of(context).cardColor,
                                blurRadius: 4.0)
                          ],
                          shape: BoxShape.circle,
                          image: DecorationImage(
                            image: AssetImage('static/gsy_cat.png'),
                            fit: BoxFit.cover,
                          )),
                    ),
                  ),
                  Text(
                    "Flutter is Google's portable UI toolkit for crafting beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. ",
                    maxLines: 3,
                    softWrap: true,
                    overflow: TextOverflow.ellipsis,
                    style: TextStyle(fontSize: 16),
                  )
                ],
              ),
            ),
          ),
        ));
  }
}
